dofile (getScriptPath() .. "\\..\\processor\\processor.lua")

if not processor.InitWatchdog then

dofile (getScriptPath() .. "\\..\\processor\\saver.lua")
dofile (getScriptPath() .. "\\..\\lib\\lib.lua")


function processor:InitWatchdog(script_id)
	if not self.watchdog_start_delay then
		self.watchdog_start_delay = 30000
		self.watchdog_start_time = processor:GetTime()
	else
		self:CloseSaver("watchdog")
	end
	self.watchdog_id = script_id
	--local file = getScriptPath() .. "\\..\\data\\watchdog\\" .. script_id .. ".dog"
	local file = lib.path.watchdog .. script_id .. ".dog"
	lib:remove(file)
	self:InitSharedSaver("watchdog", file)
end


processor:AddTimer(function()
	if processor.watchdog_id
		and processor:IsDelay(processor.watchdog_start_time, processor.watchdog_start_delay)
	then
		processor:save("watchdog", "")
	end
end)


end -- of file
